
DEFINITION MODULE PcScreen;

(*
Author:     John Tal  02/27/86 (Southfield, MI)
            Inspired by John Beidler & Paul Jockowitz
            (University of Scranton)
            Format for Color Support Inspired by
              Ian Mackay of Computer Methods Canada

Updated:    Donald Dumitru   03/18/86 to work under ITC's SDS
Updated:    John Tal         04/02/86 implementing Donald's changes into
                                      Logitech Version.
Updated:    Richard Polunsky 04/08/86 to correct attribute list
                                      and do hardware detection
Updated:    John Tal         04/08/86 implementing Richard's changes into
                                      Logitech Version.
                                      Added Color support.
Updated:    John Tal         04/15/86 Changes required for developing
                                      TextWindows module.

                             04/16/86 Made major changes in determining
                                      color attributes which makes this
                                      version now much different than
                                      what was co-developed with ITC's
                                      SDS.
                                      Eliminated numbers for colors and
                                      substituted words instead.
                                      This required creating a unique
                                      code sheme which is not compatible
                                      with standard IBM Basica Color
                                      Statements.
                                      This was done in-part to enhance our
                                      move into other environments.

*)

FROM SYSTEM IMPORT ADDRESS;


(* Attributes in all lowercase are color foreground
       "       "  "  uppercase are color background
   Attributes with first letter uppercase are Monochrome attributes
*)

EXPORT QUALIFIED
  black,blue,green,cyan,red,magenta,brown,ltgrey,
  dkgrey,ltblue,ltgreen,ltcyan,ltred,ltmagenta,yellow,white,

  BLACK,BLUE,GREEN,CYAN,RED,MAGENTA,YELLOW,WHITE,BLINK,

  Invisible,Bold,Highlight,Light,Italic,Underline,Outline,Shadow,
  Blink,Reverse,Normal,

  Cls, EraseLine, DisplayString, DisplayStringMid, WriteScreenChar,
  ReadScreenChar, WriteScreenCol, ReadScreenCol;

CONST
(* color support usage    ex.   White characters on a Red background
                                DisplayString(1,1,white+RED,'Hi Ma!');
*)
(* ----  foreground  ---- *)
 black     = 0H;
 blue      = 01H;
 green     = 02H;
 cyan      = 03H;
 red       = 04H;
 magenta   = 05H;
 brown     = 06H;
 ltgrey    = 07H;
 dkgrey    = 08H;
 ltblue    = 09H;
 ltgreen   = 0AH;
 ltcyan    = 0BH;
 ltred     = 0CH;
 ltmagenta = 0DH;
 yellow    = 0EH;
 white     = 0FH;
(* ----  background  ---- *)
 BLACK   = 0H;
 BLUE    = 10H;
 GREEN   = 20H;
 CYAN    = 30H;
 RED     = 40H;
 MAGENTA = 50H;
 YELLOW  = 60H;
 WHITE   = 70H;
 BLINK   = 80H;

(* defined by JTal to be de-coded by PcScreen
   example:  DisplayString(10,4,Blink+Underline,XStr[a]);
*)
 Invisible = 0;   (* PC *)
 Bold      = 1;   (* GEM *)
 Highlight = 1;   (* PC *)
 Light     = 2;   (* GEM *)
 Italic    = 4;   (* GEM *)
 Underline = 8;   (* PC/GEM *)
 Outline   = 16;  (* GEM *)
 Shadow    = 32;  (* GEM *)
 Blink     = 64;  (* PC *)
 Reverse   = 128; (* PC *)
 Normal    = 256; (* PC~GEM *)


PROCEDURE Cls;

PROCEDURE EraseLine(Row : CARDINAL);

PROCEDURE DisplayString(Row,Col,Color : CARDINAL; Str : ARRAY OF CHAR);

PROCEDURE DisplayStringMid(Row,Col,Color : CARDINAL; Str : ARRAY OF CHAR;
                           beg,len : CARDINAL);

PROCEDURE WriteScreenChar(Row,Col,Color : CARDINAL; Letter : CHAR);

PROCEDURE ReadScreenChar(Row,Col : CARDINAL) : CHAR;

PROCEDURE WriteScreenCol(Row,Col,Color : CARDINAL);

PROCEDURE ReadScreenCol(Row,Col : CARDINAL) : CARDINAL;

END PcScreen.
